#include "optimized_trie.hh"

const OptimizedTrie* OptimizedTrie::ith_son(unsigned i) const
{
  return this + first_son_delta + i;
}

char OptimizedTrie::get_nb_sons() const
{
  return nb_sons;
}

void OptimizedTrie::print (unsigned offset) const
{
  for (unsigned i = 0; i < offset; ++i)
    std::cout << " ";
  std::cout << value;
  std::cout << " " << (unsigned) nb_sons << " " << frequency;
  std::cout << std::endl;
  for (unsigned i = 0; i < nb_sons; ++i)
    ith_son(i)->print(offset + 1);
}


